From deb7dec7eee95464c2b7d8090611eba12ecbff44 Mon Sep 17 00:00:00 2001 From: Debian Science Team Date: Sun, 19 Feb 2023 11:01:48 +0000 Subject: [PATCH] Use fixed seeds for reproducible pseudorandomness Author: Rebecca N. Palmer Forwarded: no Gbp-Pq: Name fix_random_seeds.patch --- doc/source/getting_started/comparison/comparison_with_r.rst | 1 + doc/source/user_guide/advanced.rst | 1 + doc/source/user_guide/visualization.rst | 1 + 3 files changed, 3 insertions(+) diff --git a/doc/source/getting_started/comparison/comparison_with_r.rst b/doc/source/getting_started/comparison/comparison_with_r.rst index f91f4218..ac762876 100644 --- a/doc/source/getting_started/comparison/comparison_with_r.rst +++ b/doc/source/getting_started/comparison/comparison_with_r.rst @@ -241,6 +241,7 @@ In pandas we may use :meth:`~pandas.pivot_table` method to handle this: import random import string + random.seed(123456) # for reproducibility baseball = pd.DataFrame( { diff --git a/doc/source/user_guide/advanced.rst b/doc/source/user_guide/advanced.rst index b8df21ab..253033ea 100644 --- a/doc/source/user_guide/advanced.rst +++ b/doc/source/user_guide/advanced.rst @@ -595,6 +595,7 @@ they need to be sorted. As with any index, you can use :meth:`~DataFrame.sort_in import random + random.seed(123456) # for reproducibility random.shuffle(tuples) s = pd.Series(np.random.randn(8), index=pd.MultiIndex.from_tuples(tuples)) s diff --git a/doc/source/user_guide/visualization.rst b/doc/source/user_guide/visualization.rst index 147981f2..2b05082b 100644 --- a/doc/source/user_guide/visualization.rst +++ b/doc/source/user_guide/visualization.rst @@ -1019,6 +1019,7 @@ be passed, and when ``lag=1`` the plot is essentially ``data[:-1]`` vs. :suppress: np.random.seed(123456) + random.seed(123456) # for reproducibility - bootstrap_plot uses random.sample .. ipython:: python -- 2.30.2